<template>
  <section>
    <el-tabs v-model="activeName" type="card" @tab-click="$router.push('/page/suppliesIndex')">
      <el-tab-pane
        v-for="(item,index) in acList"
        :label="item.label"
        :name="item.name"
        :key="index"
      ></el-tab-pane>
    </el-tabs>
    <div>
      <comm v-if="active" :is="activeName" :detail="detail"></comm>
    </div>
  </section>
</template>
<script>
export default {
  name: "suppiesIndex",
  data() {
    return {
      activeName: "puts",
      acList: [
        {
          label: "入库管理",
          name: "puts"
        },
        {
          label: "出库管理",
          name: "storage"
        },
        {
          label: "当前库存",
          name: "repertory"
        },
        {
          label: "库存盘点",
          name: "inventory"
        }
      ],
      tabsIndex: 0,
      active: false,
      detail: "",
      durg_id: ""
    };
  },
  created() {},
  mounted() {
    let th = this;
    th.active = true;
    if (th.$route.query.id != undefined) {
      let durg_id = th.jieMi(th.$route.query.id);
      if (durg_id) {
        if (durg_id == 2) {
          th.activeName = "storage";
        }
        if (durg_id == 4) {
          th.activeName = "inventory";
        }
      }
    }
  },
  activated() {},
  methods: {},
  components: {
    storage: () => import("./_child/storage"),
    puts: () => import("./_child/puts"),
    repertory: () => import("./_child/repertory"),
    inventory: () => import("./_child/inventory")
    // vip: () => import("./vip")
  }
};
</script>
<style lang="scss" scoped>
</style>

